<script>
	import config from '@/config'
	import store from '@/store'
	import {
		getToken
	} from '@/utils/auth'
	import Vue from 'vue'

	export default {
		onLaunch: function() {
			// console.warn('当前组件仅支持 uni_modules 目录结构 ，请升级 HBuilderX 到 3.1.0 版本以上！')
			// console.log('App Launch')
			uni.hideTabBar()
			this.initApp()
			uni.getSystemInfo({
				success: function(e) {
					// #ifndef MP
					Vue.prototype.StatusBar = e.statusBarHeight;
					if (e.platform == 'android') {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 45;
					};
					// #endif

					// #ifdef MP-WEIXIN || MP-QQ
					Vue.prototype.StatusBar = e.statusBarHeight;
					let capsule = wx.getMenuButtonBoundingClientRect();
					if (capsule) {
						Vue.prototype.Custom = capsule;
						// Vue.prototype.capsuleSafe = uni.upx2px(750) - capsule.left + uni.upx2px(750) - capsule.right;
						Vue.prototype.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
					} else {
						Vue.prototype.CustomBar = e.statusBarHeight + 50;
					}
					// #endif		


					// #ifdef MP-ALIPAY
					Vue.prototype.StatusBar = e.statusBarHeight;
					Vue.prototype.CustomBar = e.statusBarHeight + e.titleBarHeight;
					// #endif
				}
			})

			Vue.prototype.ColorList = [{
					title: '嫣红',
					name: 'red',
					color: '#e54d42'
				},
				{
					title: '桔橙',
					name: 'orange',
					color: '#f37b1d'
				},
				{
					title: '明黄',
					name: 'yellow',
					color: '#fbbd08'
				},
				{
					title: '橄榄',
					name: 'olive',
					color: '#8dc63f'
				},
				{
					title: '森绿',
					name: 'green',
					color: '#39b54a'
				},
				{
					title: '天青',
					name: 'cyan',
					color: '#1cbbb4'
				},
				{
					title: '海蓝',
					name: 'blue',
					color: '#0081ff'
				},
				{
					title: '姹紫',
					name: 'purple',
					color: '#6739b6'
				},
				{
					title: '木槿',
					name: 'mauve',
					color: '#9c26b0'
				},
				{
					title: '桃粉',
					name: 'pink',
					color: '#e03997'
				},
				{
					title: '棕褐',
					name: 'brown',
					color: '#a5673f'
				},
				{
					title: '玄灰',
					name: 'grey',
					color: '#8799a3'
				},
				{
					title: '草灰',
					name: 'gray',
					color: '#aaaaaa'
				},
				{
					title: '墨黑',
					name: 'black',
					color: '#333333'
				},
				{
					title: '雅白',
					name: 'white',
					color: '#ffffff'
				},
			]
			//判断是否在微信浏览器
			// if (this.$wx.isWechat()) {
			// 	if (uni.getStorageSync('openId') == undefined || uni.getStorageSync('openId') == null ||
			// 		uni.getStorageSync('openId') == "") {
			// 		if (options.query.code) { // 通过code  获取登录信息  调用后台接口

			// 		}
			// 	}
			// }
		},
		onShow: function() {
			uni.hideTabBar()
			// console.log('App Show')
		},
		onHide: function() {
			// console.log('App Hide')
		},
		methods: {
			// 初始化应用
			initApp() {
				// 初始化应用配置
				this.initConfig()
				// 检查用户登录状态
				//#ifdef H5
				if (this.$wx.isWechat()) {
					// this.checkLogin()
				}
				//#endif

			},
			initConfig() {
				this.globalData.config = config
			},
			// checkLogin() {
			// 	// if (!getToken()) {
			// 	// 	this.$tab.reLaunch('/pages/index/index')
			// 	// } 
			// 	this.$tab.reLaunch('/pages/index/index')
			// },


		}
	}
</script>

<style lang="scss">
	/* 注意要写在第一行，同时给style标签加入lang="scss"属性 */
	@import "uview-ui/index.scss";

	@import "@/static/ico/iconfont.css";
	/*每个页面公共css */
	@import "colorui/main.css";
	@import "colorui/icon.css";
	@import '@/uni_modules/uni-scss/index.scss';
	/* #ifndef APP-NVUE */
	@import '@/static/customicons.css';
	// 设置整个项目的背景色
	// page {
	// 	background-color: #fff;
	// }

	/* #endif */
	// .example-info {
	// 	font-size: 14px;
	// 	color: #333;
	// 	padding: 10px;
	// }
	.pagesPadding {
		padding: 0 20rpx;
	}
    /deep/ .uni-select__input-text{
		font-size:28rpx!important;
		line-height: 40rpx !important;
	}
	/deep/ .uni-select__selector-scroll{
		.uni-select__selector-item{
			font-size:28rpx!important;
			line-height: 40rpx !important;
		}
	}
	/deep/ .u-loadmore__content__text {
		line-height: 40rpx !important;
		font-size: 28rpx !important;
	}

	/deep/ .u-button--mini {
		height: 48rpx !important;
		line-height: 48rpx !important;
		font-size: 26rpx !important;

		.u-icon__icon {
			font-size: 28rpx !important;
		}

		.u-button__text {
			font-size: 26rpx !important;
		}
	}

	/deep/ .u-button--primary {
		background-color: #3770F6 !important;
		border-color: #3770F6 !important;
		color: #fff !important;
	}

	/deep/ .u-button--plain.u-button--primary {
		background-color: #fff !important;
		color: #3770F6 !important;
	}

	/deep/ .u-tag--mini {
		height: 40rpx !important;
		line-height: 40rpx !important;
		font-size: 26rpx !important;

		.u-tag__text--mini {
			font-size: 24rpx !important;
		}
	}

	/deep/ .u-radio-group {
		line-height: 40rpx !important;
	}

	/deep/ .u-form-item {
		font-size: 24rpx !important;
		line-height: 40rpx !important;

		.u-form-item__body__left__content__label {
			font-size: 30rpx !important;
		}

		.u-input__content__field-wrapper__field {
			font-size: 26rpx !important;
		}

		.u-form-item__body__right__message {
			font-size: 24rpx !important;
			line-height: 40rpx !important;
		}

		.u-textarea__field {
			font-size: 26rpx !important;
		}
	}

	/deep/ .u-textarea__field {
		font-size: 26rpx !important;
	}
	/deep/ .u-textarea__count {
		font-size: 26rpx !important;
	}

	/deep/ .u-input {
		padding: 6rpx 8rpx !important;

		.u-input__content__field-wrapper__field {
			line-height: 40rpx !important;
			font-size: 32rpx !important;
		}
	}

	/deep/ .u-action-sheet {
		font-size: 24rpx !important;
		line-height: 40rpx !important;

		.u-action-sheet__header__title {
			font-size: 24rpx !important;
		}

		.u-action-sheet__item-wrap__item__name {
			font-size: 24rpx !important;
		}

		.u-icon__icon {
			font-size: 24rpx !important;
		}
	}

	/deep/ .u-badge {
		font-size: 24rpx !important;
		line-height: 22rpx !important;
			
		
	}
	/deep/ .u-badge--error{
		min-width: 24rpx;
		text-align: center;
		padding: 4rpx 6rpx !important;
		line-height: 24rpx !important;
		background-color: red !important;
		display: block !important;
	}

	/deep/ .u-upload__deletable {
		width: 32rpx !important;
		height: 32rpx !important;
		line-height: 32rpx !important;

		.u-icon__icon {
			color: #fff !important;
			line-height: 28rpx !important;
		}
	}

	//  图片上传 组件弹窗
	/deep/ .picshowContainers {
		.u-upload__button {
			width: 140rpx !important;
			height: 140rpx !important;
		}

		.u-upload__wrap__preview__image {
			width: 140rpx !important;
			height: 140rpx !important;
		}

		.u-upload__status__message {
			font-size: 24rpx !important;
		}

		.u-loading-icon__spinner {
			width: 24rpx !important;
			height: 24rpx !important;
		}
	}

	/deep/ .u-icon__icon {
		font-size: 32rpx !important;
	}

	.uni-system-preview-image {
		z-index: 200000 !important;
	}

	/deep/ .u-toast__content__text {
		font-size: 28rpx !important;
		line-height: 40rpx !important;
	}
	/deep/ .uni-simple-toast__text {
		font-size: 28rpx !important;
		line-height: 40rpx !important;
	}

	/deep/ .pagesDetail {
		.u-tabs__wrapper__nav__item__text {
			font-size: 26rpx !important;
			line-height: 78rpx;
			height: 78rpx;
			padding: 0 30rpx;
			text-align: center;
		}

		.u-tabs__wrapper__nav__line {
			bottom: 10rpx !important;
			height: 4rpx !important;
		}

		.u-badge {
			position: absolute;
			right: 6rpx !important;
			min-width: 24rpx;
			text-align: center;
			display: block !important;
			font-size: 24rpx !important;
			margin-left: 0rpx !important;
			top: 8rpx !important;
			// font-size:20rpx!important;
			line-height: 24rpx !important;
			background-color: red !important;
		}
	}

	/deep/ .u-modal__content__text {
			font-size: 36rpx !important;
			line-height: 40rpx !important;
		}
	/deep/ 	.u-modal__button-group__wrapper{
			height: 96rpx !important;
		}
	/deep/ .u-modal__button-group__wrapper__text {
		font-size: 36rpx !important;
		line-height: 40rpx !important;
	}
	/deep/ .uni-modal {
		max-width: 80% !important;
		.uni-modal__title{
			font-size: 36rpx !important;
			line-height: 66rpx !important;
			line-height: 66rpx !important;
		}
		.uni-modal__bd{
			font-size: 36rpx !important;
			// line-height: 40rpx !important;
		}
		.uni-modal__ft{
			font-size: 36rpx !important;
			line-height: 96rpx !important;
			height: 96rpx !important;
		}
		
	}
	/deep/ .uni-date__x-input{
		font-size: 32rpx !important;
	}
	/deep/ .uni-calendar__content{
		font-size: 28rpx !important;
		.uni-calendar__header-text{
			font-size: 28rpx !important;
		}
		.uni-calendar-item__weeks-box-item {
			font-size: 28rpx !important;
		}
		.uni-calendar__weeks-day-text{
			font-size: 28rpx !important;
		}
		.uni-calendar-item__weeks-box-text {
			font-size: 28rpx !important;
		}
		.uni-datetime-picker-text{
			font-size: 28rpx !important;
		}
		.uni-datetime-picker-item{
			font-size: 28rpx !important;
		}
		.uni-datetime-picker-btn-text{
			font-size: 28rpx !important;
		}
	}
	/deep/ .uni-simple-toast__text{
		font-size: 28rpx !important;
	}
	
</style>